package com.zzty.txj1.dao;


import com.zzty.txj1.entity.SelfExamTransaction;
import com.zzty.txj1.entity.TeamExamTransaction;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TeamExamTransactionDao {
    @Select("select * from teamExamTransaction where teamExamId=#{teamExamId} and groupId=#{groupId}")
    TeamExamTransaction checkFirstLogIn(TeamExamTransaction teamExamTransaction);

    @Insert("insert into teamExamTransaction (teamExamId,groupId,startTime) values (#{teamExamId},#{groupId},#{startTime})")
    Integer initTeamExamTransaction(TeamExamTransaction teamExamTransaction);

    @Select("select startTime from teamExamTransaction where teamExamId=#{teamExamId} and groupId=#{groupId}")
    String getStartTime(TeamExamTransaction teamExamTransaction);

    @Update("update teamExamTransaction set answerUrl=#{answerUrl},spendTime=#{spendTime} where " +
            "teamExamId=#{teamExamId} and groupId=#{groupId}")
    Integer updateUrlSpendTime(TeamExamTransaction teamExamTransaction);

    @Select("select id from groupp  where userName1=#{userName1}")
    public Integer getId(String name);
}
